package com.whut.whw.post;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.GridView;

/**
 * <pre>
 *  desc:用于重新计算GridView的高度
 *  Created by 忘尘无憾 on 2017/06/20.
 *  version:
 * </pre>
 */
public class PostGridView extends GridView {
    public PostGridView(Context context) {
        super(context);
    }

    public PostGridView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public PostGridView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }

    @Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
                MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);
    }
}
